package com.itfreer.power.dao.logging;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

import org.springframework.beans.BeanUtils;

import com.itfreer.form.api.JdbcBaseEntity;
import com.itfreer.power.entity.logging.LogInfo;

@Entity(name = "sso_visit_logging")
public class JdbcLogInfo implements JdbcBaseEntity<LogInfo> {
	
	/**
	 * 唯一值
	 */
	@Id
	@Column(name = "id", length = 50, nullable = false)
	private String id;

	/**
	 * 操作用户
	 */
	@Column(name = "s_user", length = 50)
	private String user;
	
	/**
	 * 操作时间
	 */
	@Column(name = "d_time")
	private Date time;
	
	/**
	 * 操作IP
	 */
	@Column(name = "s_ip", length = 50)
	private String ip;
	
	/**
	 * 操作功能名称
	 */
	@Column(name = "s_funName", length = 200)
	private String funName;
	
	/**
	 * 操作功能类型
	 */
	@Column(name = "s_funType", length = 50)
	private String funType;
	
	/**
	 * 操作结果
	 */
	@Column(name = "s_result", length = 50)
	private String result;
	
	/**
	 * 操作备注
	 */
	@Column(name = "s_info", length = 254)
	private String info;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getFunName() {
		return funName;
	}

	public void setFunName(String funName) {
		this.funName = funName;
	}

	public String getFunType() {
		return funType;
	}

	public void setFunType(String funType) {
		this.funType = funType;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public String getInfo() {
		return info;
	}

	public void setInfo(String info) {
		this.info = info;
	}

	@Override
	public void from(LogInfo t) {
		BeanUtils.copyProperties(t, this);
	}

	@Override
	public LogInfo toEntity() {
		LogInfo toEntity = new LogInfo();
		BeanUtils.copyProperties(this, toEntity);
		return toEntity;
	}
}
